import cv2
import numpy as np

height, width = 300, 400
blank_image = np.zeros((height, width, 3), dtype=np.uint8)

pt1, pt2 = (0, 200), (300, 0)  # 起点坐标、终点坐标
color = (91, 137, 254)  # 直线颜色
thickness = 2  # 粗细
cv2.rectangle(blank_image, pt1, pt2, color, thickness)

cv2.imshow('Line', blank_image)
cv2.waitKey(0)
cv2.destroyAllWindows()
